package com.cunyme;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper{

	public static final String TAG = DBHelper.class.getSimpleName();
	
	public static final String DBname = "CUNY_news";
	public static final int DBversion = 1;
	public static final String TABLE = "news";
	
	public DBHelper(Context context ) {
		super(context, DBname, null, DBversion);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		String sql  = "create table " + TABLE + "( title TEXT, link TEXT )";		
		db.execSQL(sql);
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL("drop table if exists " +  TABLE);
		this.onCreate(db);	
		
	}

}
